package com.foreknow.constrator;

/**
 * 方法的重载
 * 方法名相同，参数的个数以及类型不同
 * 与返回值类型无关
 */
public class Test {
  public int sum(int a,int b) {
    return a+b;
  }

  public int sum(int a,int b,int c){
    return a+b+c;
  }

  public static void main(String[] args) {
    Test test= new Test();
    int s = test.sum(1,2,3);
    System.out.println(s);

   int s1 =  test.sum(12,23);
    System.out.println(s1);
  }
}
